#ifndef TEXTEDITOR_H
#define TEXTEDITOR_H

#include <QMainWindow>
#include <QSignalMapper>

#include "ui_texteditor.h"
class mdiChild;
class texteditor : public QMainWindow
{
	Q_OBJECT

public:
	texteditor(QWidget *parent = 0);
	~texteditor();
private slots:
    void updateMenu();
    void updateWindowMenu();
    void on_action_New_triggered();
    void on_action_Open_triggered();
    void setActiveWindow(QWidget* window);
    void on_action_Save_triggered();

    void on_action_SaveAs_triggered();

    void on_action_Exit_triggered();

    void on_action_Undo_triggered();

    void on_action_Redo_triggered();

    void on_action_Cut_triggered();

    void on_action_Copy_triggered();

    void on_action_Paste_triggered();

    void on_action_Close_triggered();

    void on_action_CloseAll_triggered();

    void on_action_Next_triggered();

    void on_action_Previous_triggered();

    void on_action_Title_triggered();

    void on_action_Cascade_triggered();

private:
    mdiChild* activeSubWindow();
    mdiChild* createMdiChild();
    QMdiSubWindow* getExistingSubWindow(const QString& filePath);
    void readSettings();
    void writeSettings();
private:
	Ui::texteditorClass ui;
    QAction* actionSeperator;
    QSignalMapper* windowsMapper;

    // QWidget interface
protected:
    void closeEvent(QCloseEvent *event);
};

#endif // TEXTEDITOR_H
